$def with (privData)
<!DOCTYPE html>
<html>
<head>
$:privData['render'].header(privData)
<script charset="utf-8" src="$staticUrl('common/kindeditor/kindeditor-all.js')"></script>
<script charset="utf-8" src="$staticUrl('common/kindeditor/lang/zh-CN.js')"></script>
<script src="$staticUrl('common/lychee-upload/edite_upload.js')" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="$staticUrl('common/lychee-upload/upload.css')">
<link href="$staticUrl('common/lychee-upload/iconfont/iconfont.css')" media="all" rel="stylesheet" type="text/css" />
</head>
<body class="hold-transition skin-blue sidebar-mini">
$:privData['render'].pageheader(privData)
<div class="col-md-12 p5-nav-bar">
    <div class="col-sm-12">
        <a href="$makeUrl('/index')">
            <span class="glyphicon glyphicon-home"></span>
            <span>首页</span>
        </a>&gt;&gt;
        <span>媒体管理</span>&gt;
        <a href="$makeUrl('/articles')"><span>文章列表</span></a>&gt;
        <span>编辑文章</span>
    </div>
</div>
<section class="content">
    <div class="row">
      <div class="has-max">
        <div class="col-md-12 col-lg-12">
            <div class="box box-info">
                <div class="box-header with-border">
                    <h3 class="box-title">编辑文章</h3>
                    <div class="box-tools pull-right">
                        <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="glyphicon glyphicon-minus"></i></button>
                    </div>
                </div>
                <div class="box-body" style="display:block;">
                    <form id="formvalidate" action="/articles/modify" method="post" class="form-horizontal" encType="multipart/form-data">
                        <div class="form-group">
                            <label for="category" class="col-md-offset-1 col-md-2 control-label col-lg-1">* 分类:</label>
                            <div class="col-md-7 col-lg-8">
                                <SELECT name="category" id="category" class="form-control">
                                    $for item in privData['CATEGORIES_LIST']:
                                    <option value="$:item.id"
                                            $if item.id == privData['ARTICLE'].category.id:
                                            selected="selected"
                                    >$:item.name</option>
                                </SELECT>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="name" class="col-md-offset-1 col-md-2 control-label col-lg-1">* 标题:</label>
                            <div class="col-md-7 col-lg-8">
                                <input name="name" type="text" id="name" value="$privData['ARTICLE'].name" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="name" class="col-md-offset-1 col-md-2 control-label col-lg-1">* 缩略图:</label>
                            <div class="col-md-7 col-lg-8">
                                    <div class="file-input file-input-new">
                                        <div class="file-preview ">
                                            <div class="close fileinput-remove">×</div>
                                            <div class="file-drop-disabled">
                                                    <div class="file-preview-thumbnails preview-img" id="productimg">
                                                        <div class="file-preview-frame" id="preview_123456">
                                                           <div class="kv-file-content">
                                                               <img src="data:image/jpg;base64,$:privData['ARTICLE'].thumbnail.thumbnail" class="file-preview-image" title="" alt="" style="width:160px;height:160px;">
                                                           </div>
                                                           <div class="file-thumbnail-footer">
                                                               <div class="file-footer-caption" title="'">原始图片</div>
                                                               <div class="file-actions">
                                                                   <div class="file-footer-buttons" deleteid="preview_123456"></samp>
                                                                       <button type="button" deleteid="preview_123456" class="btn btn-xs btn-default delete-btn" title="删除" onclick="deleteme(this,'pro')">
                                                                           <i class="iconfont icon-shanchu"></i>
                                                                       </button>
                                                                   </div>
                                                               </div>
                                                           </div>
                                                        </div>
                                                </div>
                                                <div class="clearfix"></div>
                                            </div>
                                        </div>
                                        <div class="input-group file-caption-main">
                                            <div tabindex="500" class="form-control file-caption  kv-fileinput-caption" onclick="clickinput('files');">
                                                <div class="file-caption-name"></div>
                                            </div>
                                           <div class="input-group-btn">
                                               <button type="button" tabindex="500" onclick="clearAll('productimg','file')" title="Clear selected files" class="btn btn-default  fileinput-remove fileinput-remove-button" style="height: 35px;">
                                                    <i class="iconfont icon-shanchu"></i>
                                                    <span class="delete-span">清空</span>
                                               </button>
                                               <div tabindex="500" class="btn btn-primary btn-file">
                                                   <i class="iconfont icon-wenjianjia"></i>&nbsp;
                                                   <span class="">选择</span>
                                                   <input name="file"  class="lychee-file" id="file" type="file" accept="image/*">
                                               </div>
                                           </div>
                                       </div>
                                </div>
                            </div>
                        </div>
                         <input name="select" id="select" value="0" type="text" style="display:none;"/>
                         <div class="form-group">
                            <label for="brief" class="col-md-offset-1 col-md-2 control-label col-lg-1">* 简介:</label>
                            <div class="col-md-7 col-lg-8">
                                 <textarea name="summary"  id="summary" class="form-control"  />$:privData['ARTICLE'].summary</textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="content" class="col-md-offset-1 col-md-2 control-label col-lg-1">内容:</label>
                            <div class="col-md-7 col-lg-8">
                                <textarea rows="10" cols="5" name="content" id="content" class="form-control">$:privData['ARTICLE'].content</textarea>
                                <script type="text/javascript">
                                    KindEditor.ready(function(K) {  
                                    window.editor = K.create('#content', {  
                                    afterBlur: function(){  
                                    this.sync();  
                                    },  
                                    uploadJson : '/upload/kindImage',  
                                    resizeType : 0,  
                                    width: '665px',  
                                    height: '600px',  
                                    items: ['preview', '|', 'undo', 'redo', '|', 'template', 'code', 'cut', 'copy', 'paste',  
                                        'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',  
                                        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',  
                                        'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',  
                                        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',  
                                        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image',   
                                        'table', 'hr', 'emoticons', 'baidumap', 'pagebreak', 'anchor', 'link', 'unlink'],
                                        imageUploadJson:'/upload/kindUrls'  
                                         });  
                                    });  
                                    </script>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-10">
                                <input name="id" type="hidden" value="$:privData['ARTICLE'].id"/>
                                <button type="button" onclick="setnumber()" class="btn btn-info pull-right" id="submits">保存</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
      </div>
    </div>
</section>
$:privData['render'].foot(privData)
<script src="$staticUrl('common/admin/admin.validate.min.js')"></script>
<script>
function setnumber(){
   var count = document.getElementById('file');
   var sele =  document.getElementById('select');
   sele.value = count.files.length;
   document.getElementById('formvalidate').submit();
}
</script>
</body>
</html>
